package com.scap.dfs.model;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the TRN_DAILY database table.
 * 
 */
@Embeddable
public class TrnDailyPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Column(name="HOSPITAL_CODE",columnDefinition="varchar(20)")
	private String hospitalCode;

	@Column(name="INVOICE_NO",columnDefinition="varchar(50)")
	private String invoiceNo;

	@Column(name="INVOICE_DATE",columnDefinition="varchar(8)")
	private String invoiceDate;

	@Column(name="RECEIPT_DATE",columnDefinition="varchar(10)")
	private String receiptDate;

	@Column(name="TRANSACTION_DATE",columnDefinition="varchar(8)")
	private String transactionDate;

	@Column(name="LINE_NO",columnDefinition="varchar(20)")
	private String lineNo;

	@Column(name="INVOICE_TYPE",columnDefinition="varchar(5)")
	private String invoiceType;

	public TrnDailyPK() {
	}
	public String getHospitalCode() {
		return this.hospitalCode;
	}
	public void setHospitalCode(String hospitalCode) {
		this.hospitalCode = hospitalCode;
	}
	public String getInvoiceNo() {
		return this.invoiceNo;
	}
	public void setInvoiceNo(String invoiceNo) {
		this.invoiceNo = invoiceNo;
	}
	public String getInvoiceDate() {
		return this.invoiceDate;
	}
	public void setInvoiceDate(String invoiceDate) {
		this.invoiceDate = invoiceDate;
	}
	public String getReceiptDate() {
		return this.receiptDate;
	}
	public void setReceiptDate(String receiptDate) {
		this.receiptDate = receiptDate;
	}
	public String getTransactionDate() {
		return this.transactionDate;
	}
	public void setTransactionDate(String transactionDate) {
		this.transactionDate = transactionDate;
	}
	public String getLineNo() {
		return this.lineNo;
	}
	public void setLineNo(String lineNo) {
		this.lineNo = lineNo;
	}
	public String getInvoiceType() {
		return this.invoiceType;
	}
	public void setInvoiceType(String invoiceType) {
		this.invoiceType = invoiceType;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof TrnDailyPK)) {
			return false;
		}
		TrnDailyPK castOther = (TrnDailyPK)other;
		return 
			this.hospitalCode.equals(castOther.hospitalCode)
			&& this.invoiceNo.equals(castOther.invoiceNo)
			&& this.invoiceDate.equals(castOther.invoiceDate)
			&& this.receiptDate.equals(castOther.receiptDate)
			&& this.transactionDate.equals(castOther.transactionDate)
			&& this.lineNo.equals(castOther.lineNo)
			&& this.invoiceType.equals(castOther.invoiceType);
	}

	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.hospitalCode.hashCode();
		hash = hash * prime + this.invoiceNo.hashCode();
		hash = hash * prime + this.invoiceDate.hashCode();
		hash = hash * prime + this.receiptDate.hashCode();
		hash = hash * prime + this.transactionDate.hashCode();
		hash = hash * prime + this.lineNo.hashCode();
		hash = hash * prime + this.invoiceType.hashCode();
		
		return hash;
	}
	@Override
	public String toString() {
		return "TrnDailyPK [hospitalCode=" + hospitalCode + ", invoiceNo="
				+ invoiceNo + ", invoiceDate=" + invoiceDate + ", receiptDate="
				+ receiptDate + ", transactionDate=" + transactionDate
				+ ", lineNo=" + lineNo + ", invoiceType=" + invoiceType + "]";
	}
	
	
}